﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AcmeSportsStore
{
    public partial class PasswordView : Form
    {
        private bool compPassword;
        public PasswordView()
        {
            InitializeComponent();
        }
        
        private void btnOk_PF_Click(object sender, EventArgs e)
        {
            compPassword = Password.CompPassword(tBoxPassword_PF.Text);
            if (compPassword == true)
            {
                SportsView parent = this.Owner as SportsView;
                if (parent != null)
                {
                    parent.MainTabControl.Enabled = true;
                    parent.MainMenuFile.Enabled = true;
                    parent.MainMenuEdit.Enabled = true;
                    parent.MainMenuHelp.Enabled = true;
                    parent.MainMenuLogin.Enabled = false;
                    parent.MainMenuLogoff.Enabled = true;
                    parent.StatusLbl1.Text = "Login:\t" + tBoxName_PF.Text;
                }
            }
            else
                MessageBox.Show("Sorry, Wrong Password.");
            this.Close();
        }

        private void PasswordView_Load(object sender, EventArgs e)
        {
            tBoxName_PF.Text = "";
            tBoxPassword_PF.Text = "";
        }

        private void btnCancel_PF_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void tBoxName_PF_TextChanged(object sender, EventArgs e)
        {

        }

        private void lbPassword_Click(object sender, EventArgs e)
        {

        }

        private void tBoxPassword_PF_TextChanged(object sender, EventArgs e)
        {

        }

        private void lab_Click(object sender, EventArgs e)
        {

        }
    }
}
